#include <iostream>
#include <string>

using namespace std;

int main() {
    string s1, s2;
    int n;
    cin >> s1 >> n >> s2;
    int len1 = s1.size();
    for (int i = 0; i < n; i++) cout << s1[i];
    cout << s2;
}